<?php $this->pageHeader('Vaktrapport'); ?>

<p id="top_right_links">
    <a href="<?php echo $this->url(array('module' => 'core', 'controller' => 'event', 'action' => 'view', 'id' => $this->shift['event_id'])); ?>">
        Gå til arrangement
    </a>
     |
    <a href="<?php echo $this->url(array('module' => 'core', 'controller' => 'shift', 'action' => 'view', 'id' => $this->shift['id']), null, true); ?>">Gå til vakt</a>
</p>

<?php echo $this->message; ?>

<h1>Vaktrapport for "<?php echo $this->shift->name; ?>"</h1>

<?php
    $this->addScriptPath(APPLICATION_PATH . '/modules/core/views/scripts/shift');
    echo $this->render('_shift.phtml');
?>

<p>&nbsp;</p>

<h2>Vis rapport</h2>
<ul><li class="button"><a href="<?php echo $this->url(array('action' => 'reportpdf', 'id' => $this->shift->id)) ?>">Vis rapport (PDF)</a></li></ul>
<p class="clear" />

<h2>Rapport status</h2>

<?php
    if (!(bool)$this->shiftReport->approved) {
        echo '<p>Rapporten for denne vakten er ikke godkjent.</p><p>&nbsp;</p>';
        $this->approveReportForm->setMethod('post');
        $this->approveReportForm->setAction($this->url());
        echo $this->approveReportForm;
    } else {
        echo '<p>Rapporten for denne vakten er godkjent.</p>';
    }
?>

<p>&nbsp;</p>

<?php if (!(bool)$this->shiftReport->approved) : ?>
    <h2>Endre rapport</h2>
    <ul>
        <li class="button">
            <a href="javascript:void(0)" onclick="$('#editshiftreport').toggle();">Endre rapport</a>
        </li>
    </ul>

    <p class="clear" />

    <div id="editshiftreport" style="display:none">
    <?php
        $this->editReportForm->setMethod('post');
        $this->editReportForm->setAction($this->url());
        echo $this->editReportForm;
    ?>
    </div>
<?php endif; ?>
